package com.xiangge.synthesize.controller;

import com.xiangge.synthesize.vo.GoodsVo;
import com.xiangge.util.SynthesizeResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author lsy_server
 */
@RestController
@RequestMapping("goods")
public class GoodsController {
    @GetMapping("list")
    public SynthesizeResponse list() {
        GoodsVo goodsVo = new GoodsVo();
        goodsVo.setDetail("佛山照明天猫精灵灯泡智能LED灯泡智能家居语音球泡【支付宝】");
        goodsVo.setId(1L);
        goodsVo.setSaleNum(200536);
        goodsVo.setTitle("照明产品");
        goodsVo.setSource("天猫");
        goodsVo.setVisitUrl("//img.alicdn.com/imgextra/i3/3919645743/O1CN01TgZazd1sILBh71F91_!!2-item_pic.png");
        List<String> urls = Arrays.asList("https://img.alicdn.com/imgextra/i2/3919645743/O1CN01uO9YhJ1sILBqszCbC_!!3919645743.jpg", "https://img.alicdn.com/imgextra/i4/3919645743/O1CN01cT6HHx1sILBolVOL0_!!3919645743.jpg");
        goodsVo.setPics(urls);
        return SynthesizeResponse.ok(Collections.singletonList(goodsVo));
    }
}
